package com.red.star.wechat.data.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/6/28.
 * 结算单，每次结算生成
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_settle")
public class Settle extends BaseEntity {

    /**
     * 结算状态  0结算中  1已结算  2已取消
     */
    private Integer status;

    /**
     * 结算明细文件地址（导购+蓄客卡收益明细）
     */
    private String detailFile;

    /**
     * 结算单文件(未签字，有水印）
     */
    private String settleFile;

    /**
     * 结算单文件(签字版，有水印)
     */
    private String signSettleFile;

    /**
     * 导出给第三方的结算单文件(无水印)
     */
    private String thirdSettleFile;

    /**
     * 结算时间
     */
    private Date settleTime;

    /**
     * 导出给第三方的时间
     */
    private Date exportTime;

    /**
     * 结算单号
     */
    private String settleNo;

    private String mallCode;

    /**
     * 大区
     */
    @Transient
    private String bigRegion;

    /**
     * 小区
     */
    @Transient
    private String smallRegion;

    /**
     * 商场
     */
    @Transient
    private String mallName;

    @Transient
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date settleStartTime;

    @Transient
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date settleEndTime;

    @Transient
    private Integer storedCardId;

    @Transient
    private String storedCardName;

    public Settle(Integer status, Date settleTime, String settleNo, String mallCode) {
        this.status = status;
        this.settleTime = settleTime;
        this.settleNo = settleNo;
        this.mallCode = mallCode;
    }
}
